module UsersHelper

  def get_records_sorted_and_paginated(column_to_sort,page,per_page,order)
    if column_to_sort.nil?
      User.paginate(:per_page => per_page, :page => page).order("name ASC")
    else
      User.paginate(:per_page => per_page, :page => page).order(column_to_sort + " " + order)
    end
  end

  def get_header_info
    header_info = Hash.new()
    header_info["name"] = I18n.t('object.user.name')
    header_info["email"] = I18n.t('object.user.email')
    header_info["birth"] = I18n.t('object.user.birth')
    return header_info
  end

  def create_entity
    return User.new()
  end

end
